(function(load_require){
    if (typeof exports !== 'object' && typeof module === 'undefined'){
        load_require();
    } else {
        var factory = require('./factory');
        module.exports = factory;
    };

})(function(){

    var requireURI  = ''
    ,   header      = document.getElementsByTagName('head')[0]
    ,   script      = document.getElementsByTagName('script');

    for(var i = 0; i < script.length; i++){
        if(script.item(i).getAttribute('six7-main')){
            requireURI = script.item(i).getAttribute('src');
            break;
        };
    };

    requireURI = requireURI.replace('index.js', 'require/index.js');
    script = document.createElement('script');
    script.type = 'text/javascript';
    script.src = requireURI;
    script.onload = function(){
        if ( header && script.parentNode ) {
            header.removeChild( script );
        }
    };

    header.insertBefore( script, header.firstChild );

});